# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Project Name: luffcity study project
File Name: 线程队列Queue.py
Author: kij
Create Date: 2021/3/20
-------------------------------------------------
"""
import queue
# 先进先出->队列
# q= queue.Queue(3)
# q.put('first')
# q.put(2)
# q.put([3,3,3])
# # q.put_nowait('5')
# # q.put({4:'wode'})
# print(q.get())
# print(q.get())
# print(q.get())
# print(q.get_nowait())

# # 后进先出->堆栈
# q = queue.LifoQueue(3)
# q.put('first')
# q.put(2)
# q.put([3,3,3])
# print(q.get())
# print(q.get())
# print(q.get())

# 优先级队列
q = queue.PriorityQueue(3)
q.put(10)
q.put(50)
q.put(20)
print(q.get())
print(q.get())
print(q.get())

